package com.vf.admin.miaodong.controller;

import com.vf.admin.common.BaseController;
import com.vf.admin.common.splitpage.SplitPageBean;
import com.vf.admin.miaodong.entity.AppCommentReply;
import com.vf.admin.miaodong.service.AfterCommentReplyService;
import com.vf.admin.utils.StringEx;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.HashMap;
import java.util.List;
import java.util.Map;


@Controller
@RequestMapping("/after/commentreply")
public class AfterCommentReplyController extends BaseController {


    @Autowired
    AfterCommentReplyService afterCommentReplyService;


    //查看评论回复列表
    @RequestMapping("/list")
    public String list(SplitPageBean splitPageBean, String startDate, String endDate, String nick, String phone) {
        try {
            Map<String, Object> paramap = new HashMap<>();
            if (StringEx.isNotNull(startDate)) {
                paramap.put("startDate", startDate);
            }

            if (StringEx.isNotNull(endDate)) {
                paramap.put("endDate", endDate);
            }

            if (StringEx.isNotNull(nick)) {
                paramap.put("nick", nick);
            }

            if (StringEx.isNotNull(phone)) {
                paramap.put("phone", phone);
            }

            paramap.put("status", 1);
            List<AppCommentReply> appCommentReplyList = afterCommentReplyService.list(paramap, splitPageBean);
            request.setAttribute("list", appCommentReplyList);
            request.setAttribute("splitPage",splitPageBean);
            return this.sucess("/web/after/dynamic/plhflist");
        } catch (Exception e) {
            return this.error("系统繁忙");
        }

    }
}
